<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			// 开发一款软件，根据公式（身高-108）*2=体重，可以有10斤左右的浮动。判断测试者体重为标准体重还是超重还是偏瘦
      
      var height = parseInt(prompt('请输入身高(cm)'))
      var weight = parseInt(prompt('请输入体重(斤)'))
      var weight1 = (height - 108) * 2
      var differ = weight - weight1
      if (differ > 10) {
        alert('超重')
      } else if (differ < -10) {
        alert('偏轻')
      } else if (typeof(differ) === 'number' && !isNaN(differ)) {
        alert('正常范围')
        console.log(differ)
      } else {
        alert('输入有误')
      }
		</script>
	</body>
</html>
